package 笔试记录.M9day17滴滴;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Long num = sc.nextLong();
        if(num == 0){
            System.out.println(1);
        }
        ArrayList<Long> list = new ArrayList<>();
        for (int i = 1; i <= 32; i++) {
            if(num % i == 0){
                if(solve(num / i) == i){
                    list.add(num / i);
                }
            }
        }
        System.out.println(list.size());
        Collections.sort(list);
        for (int i = 0; i < list.size(); i++) {
            System.out.print(list.get(i) + " ");
        }
    }

    public static long  solve(long num){
        return Long.bitCount(num);
    }
}
